import { useReactive } from "ahooks";
import { useModel } from "umi";
import compress from "gql-compress";

const useCreateCommodity = () => {
	const { graphqlFetch } = useModel("global");

	const state = useReactive({
		loading: false,
	});

	const createCommodity = async (values, callback) => {
		state.loading = true;
		let variables = { values };
		let res = "a";
		res && callback && callback(res);
		state.loading = false;
	};

	return { ...state, createCommodity };
};

let query = compress(``);

export default useCreateCommodity;
